import React, { useState } from 'react'

function App() {
  const [name, setName] = useState('xiao ming')
  const [age, setAge] = useState(100)
  return (
    <div>
      <h1>{name}</h1>
      <h2>{age}</h2>
      <button
        onClick={() => {
          setName('zhang san ' + Math.random())
          setAge(age + 1)
        }}
      >
        change name
      </button>
    </div>
  )
}

export default App
